Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dxf: refactor error handling in task executor #57837

Merged
merged 8 commits into from
Dec 3, 2024

Conversation

D3Hunter
Copy link
Contributor

What problem does this PR solve?

Issue Number: ref #57497

Problem Summary:

What changed and how does it work?

  • error of GetStepExecutor is fatal now
  • we don't handle error of Cleanup now, only log it, previously we will mark a randomly subtask as failed, but if all subtasks are finished, this does nothing.
  • the print stack logic in onError is removed now, I plan to add special initialized logger which will always print error stack to achieve the same effect.
  • check context error using context itself, not by the error

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 29, 2024
Copy link

tiprow bot commented Nov 29, 2024

Hi @D3Hunter. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@@ -234,22 +234,6 @@ func TestGC(t *testing.T) {
}, 10*time.Second, 500*time.Millisecond)
}

func TestFrameworkSubtaskFinishedCancel(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this case test what we do when a subtask is cancelled by other routines by CancelRunningSubtask, it's actually duplicate with TestFrameworkRunSubtaskCancelOrFailed, so merge them

Copy link

codecov bot commented Nov 29, 2024

Codecov Report

Attention: Patch coverage is 75.67568% with 27 lines in your changes missing coverage. Please review.

Project coverage is 73.9898%. Comparing base (8fe0618) to head (e12c6ee).
Report is 9 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #57837        +/-   ##
================================================
+ Coverage   73.1430%   73.9898%   +0.8468%     
================================================
  Files          1671       1702        +31     
  Lines        460633     470274      +9641     
================================================
+ Hits         336921     347955     +11034     
+ Misses       103006     100963      -2043     
- Partials      20706      21356       +650     
Flag Coverage Δ
integration 46.2054% <0.0000%> (?)
unit 72.4717% <75.6756%> (+0.1913%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 56.0779% <ø> (+3.3106%) ⬆️
parser ∅ <ø> (∅)
br 46.7820% <ø> (+0.7898%) ⬆️

mockStepExecutor.EXPECT().Cleanup(gomock.Any()).Return(nil)
err = taskExecutor.RunStep(nil)
require.EqualError(t, err, grpcErr.Error())
require.True(t, ctrl.Satisfied())

// 9. annotate grpc cancel
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we check context cancel by using ctx.Err now, no need to check this one

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Dec 3, 2024
Copy link

ti-chi-bot bot commented Dec 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: GMHDBJD, wjhuang2016

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 3, 2024
Copy link

ti-chi-bot bot commented Dec 3, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-12-03 08:29:46.675358355 +0000 UTC m=+1143574.295012870: ☑️ agreed by wjhuang2016.
  • 2024-12-03 09:58:06.240144493 +0000 UTC m=+1148873.859799011: ☑️ agreed by GMHDBJD.

@ti-chi-bot ti-chi-bot bot merged commit 3002c1c into pingcap:master Dec 3, 2024
25 checks passed
@D3Hunter D3Hunter deleted the dxf-merge-te-loop branch December 3, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants